package lab03.test03;

/**
 * Created by ASUS on 2017/12/14.
 */
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.logging.FileHandler;
public class Test {
    public static void main(String[] args) {
        String path = "D:\\test.text";
        FileOutputStream fileOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(path);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } finally {
            try {
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        try {
            FileInputStream fileInputStream = new FileInputStream(path);
            int tmp;
            while ((tmp = fileInputStream.read()) != -1) {
                System.out.println((char) tmp);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
